﻿using System;
using System.Collections;
using System.Data;
using CE.Database;

/// <summary>
/// Summary description for TASelectedInsuranceDB
/// </summary>
/// 
namespace CE.TravelInsurance
{
    public class TASelectedInsuranceDB
    {
        public TASelectedInsuranceDB()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public Int64 Insert(TASelectedInsurance taselectedinsurance)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "[sprocTASelectedInsuranceInsertUpdateSingleItem]";

            SortedList _sPara = new SortedList();
            #region Parameter
            _sPara.Add("@TAAppSeaId", taselectedinsurance.TAAppSeaId);
            _sPara.Add("@TAInsId", taselectedinsurance.TAInsId);
            _sPara.Add("@ProviderCompanyId", taselectedinsurance.ProviderCompanyId);
            _sPara.Add("@AnnualPremium", taselectedinsurance.AnnualPremium);
            _sPara.Add("@RefCEUserId", taselectedinsurance.RefCEUserId);
            _sPara.Add("@Status", taselectedinsurance.Status);
            #endregion
            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }

        public Int64 InsertMailStatus(TASelectedInsurance taselectedinsurance)
        {
            MyDatabase _db = new MyDatabase();
            Int64 _result = -1;
            string _spName = "[sprocTAMailStatusInsertUpdateSingleItem]";

            SortedList _sPara = new SortedList();
            #region Parameter
            _sPara.Add("@TAAppSeaId", taselectedinsurance.TAAppSeaId);
            _sPara.Add("@TAInsId", taselectedinsurance.TAInsId);
            _sPara.Add("@ProviderCompanyId", taselectedinsurance.ProviderCompanyId);
            _sPara.Add("@Status", taselectedinsurance.Status);
            #endregion
            _result = _db.ExecuteSP(_spName, _sPara);

            return _result;
        }
    }
}